/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.srcptit.trainning.giangnd.b2;

import java.io.IOException;
import java.util.Scanner;
class giang extends Exception{}
/**
 *
 * @author GIANG
 */
public class vidu {
    
    public static void main(String[] args) throws IOException{
        Scanner sc= new Scanner(System.in);
        //int n;
        String s="";
        int a=0;
        System.out.println("Nhap tuoi:");
        s=sc.nextLine();
        try{    
            a=Integer.parseInt(s);
            if(s.length()==0) throw new IOException();
            System.out.println("Nhap OK!");
        }catch(NumberFormatException q ){
            System.out.println("Nhap Chu");
        }catch(StringIndexOutOfBoundsException e){
            System.out.println("so Am");
        }catch(Exception e){
            System.out.println("Noi chung la loi");
        }
    }
}
